package com.guotd.ticketSystemPlus.mapper;

import com.guotd.ticketSystemPlus.entity.Flight;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.Date;
import java.util.List;

@Mapper
public interface FlightMapper {

    List<Flight> getFlights();

    List<Flight> getFlightsByPage(@Param("offset") int offset, @Param("pageSize") int pageSize);

    int getTotalCount();

    List<Flight> selectFlight(@Param("fromAirport") String fromAirport, 
                            @Param("toAirport") String toAirport, 
                            @Param("fromDate") Date fromDate);

    int addFlight(@Param("id") String id,
                  @Param("planeId") String planeId,
                  @Param("name") String name,
                  @Param("airlineId") String airlineId,
                  @Param("scheduleId") String scheduleId);

    int delFlight(@Param("id") String id);

    int updateFlight(@Param("id") String id,
                    @Param("name") String name,
                    @Param("planeId") String planeId,
                    @Param("airlineId") String airlineId,
                    @Param("scheduleId") String scheduleId);
}
